package com.ctshk.sapp.train.controller;

import com.ctshk.common.annotations.OperationLogAnnotation;
import com.ctshk.common.dto.Result;
import com.ctshk.common.enums.OperationLogModel;
import com.ctshk.common.enums.OperationLogType;
import com.ctshk.common.model.PageResponse;
import com.ctshk.common.model.TokenUser;
import com.ctshk.rpc.train.dto.TrainProductDTO;
import com.ctshk.rpc.train.dto.TrainSysAgentQueryListDTO;
import com.ctshk.rpc.train.req.TrainSysAgentQueryListReq;
import com.ctshk.rpc.train.service.ITrainProductChannelOfflineAgentCustomService;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.*;

import com.ctshk.common.web.support.BaseController;

/**
 * <p>
 * 火车票产品---线下代理商自定义用户部门设置 前端控制器
 * </p>
 *
 * @author 彭柳霖
 * @since 2021-03-15
 */
@RestController
@RequestMapping("/train-product-channel-offline-agent-custom")
public class TrainProductChannelOfflineAgentCustomController extends BaseController {

    @DubboReference
    private ITrainProductChannelOfflineAgentCustomService trainProductChannelOfflineAgentCustomService;

    @ApiOperation(value = "火車票訂單中心查詢代理公司(已弃用)", notes = "火車票訂單中心查詢代理公司(已弃用)")
    @OperationLogAnnotation(operModul = OperationLogModel.TICKET, operType = OperationLogType.QUERY, operTitle = "火車票訂單中心查詢代理公司", operDesc = "火車票訂單中心查詢代理公司")
    @PostMapping(value = "/queryAgentList")
    public Result<PageResponse<TrainSysAgentQueryListDTO>> queryAgentList(@RequestBody TrainSysAgentQueryListReq req) {
        TokenUser currentUser = getCurrentUser();
        return Result.success(trainProductChannelOfflineAgentCustomService.queryAgentList(req,currentUser));
    }

}
